package com.yhao.floatwindow;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.os.Build;
import android.os.Handler;
import android.text.TextUtils;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import com.yhao.floatwindow.FloatWindow;
import org.greenrobot.eventbus.EventBus;

public class IFloatWindowImpl extends IFloatWindow {
    private String direct = "";
    private boolean isShow;
    private ValueAnimator mAnimator;
    private FloatWindow.B mB;
    private long mCurrentTimeMillis = 0;
    private TimeInterpolator mDecelerateInterpolator;
    private boolean mDoubleFlag;
    private FloatLifecycle mFloatLifecycle;
    private FloatView mFloatView;
    private Handler mHandler;
    private boolean mLongFlag;
    private boolean mMoveFlag;
    private int mPointAngle;
    private Runnable mRunnable;
    private long mTime0;
    private boolean once = true;

    private IFloatWindowImpl() {
    }

    IFloatWindowImpl(FloatWindow.B b) {
        this.mB = b;
        if (b.mMoveType != 0) {
            this.mFloatView = new FloatPhone(b.mApplicationContext);
            initTouchEvent();
        } else if (Build.VERSION.SDK_INT >= 25) {
            this.mFloatView = new FloatPhone(b.mApplicationContext);
        } else {
            this.mFloatView = new FloatToast(b.mApplicationContext);
        }
        this.mFloatView.setSize(this.mB.mWidth, this.mB.mHeight);
        this.mFloatView.setGravity(this.mB.gravity, this.mB.xOffset, this.mB.yOffset);
        this.mFloatView.setView(this.mB.mView);
        this.mFloatLifecycle = new FloatLifecycle(this.mB.mApplicationContext, this.mB.mShow, this.mB.mActivities, new LifecycleListener() {
            /* class com.yhao.floatwindow.IFloatWindowImpl.AnonymousClass1 */

            @Override // com.yhao.floatwindow.LifecycleListener
            public void onShow() {
                IFloatWindowImpl.this.show();
            }

            @Override // com.yhao.floatwindow.LifecycleListener
            public void onHide() {
                IFloatWindowImpl.this.hide();
            }

            @Override // com.yhao.floatwindow.LifecycleListener
            public void onBackToDesktop() {
                if (!IFloatWindowImpl.this.mB.mDesktopShow) {
                    IFloatWindowImpl.this.hide();
                }
            }
        });
    }

    @Override // com.yhao.floatwindow.IFloatWindow
    public void show() {
        if (!TextUtils.isEmpty(this.mB.mTag)) {
            String str = this.mB.mTag;
            str.hashCode();
            char c = 65535;
            switch (str.hashCode()) {
                case -1311594016:
                    if (str.equals("tipView")) {
                        c = 0;
                        break;
                    }
                    break;
                case -385679662:
                    if (str.equals("floatViewRecord")) {
                        c = 1;
                        break;
                    }
                    break;
                case 666656487:
                    if (str.equals("floatViewClick")) {
                        c = 2;
                        break;
                    }
                    break;
                case 678346581:
                    if (str.equals("floatViewPause")) {
                        c = 3;
                        break;
                    }
                    break;
                case 1080880344:
                    if (str.equals("trackViewClick")) {
                        c = 4;
                        break;
                    }
                    break;
                case 1142427439:
                    if (str.equals("floatViewClickPlus0")) {
                        c = 5;
                        break;
                    }
                    break;
                case 1142427440:
                    if (str.equals("floatViewClickPlus1")) {
                        c = 6;
                        break;
                    }
                    break;
                case 1142427441:
                    if (str.equals("floatViewClickPlus2")) {
                        c = 7;
                        break;
                    }
                    break;
                case 1142427442:
                    if (str.equals("floatViewClickPlus3")) {
                        c = '\b';
                        break;
                    }
                    break;
                case 1142427443:
                    if (str.equals("floatViewClickPlus4")) {
                        c = '\t';
                        break;
                    }
                    break;
                case 1142427444:
                    if (str.equals("floatViewClickPlus5")) {
                        c = '\n';
                        break;
                    }
                    break;
                case 1142427445:
                    if (str.equals("floatViewClickPlus6")) {
                        c = 11;
                        break;
                    }
                    break;
                case 1142427446:
                    if (str.equals("floatViewClickPlus7")) {
                        c = '\f';
                        break;
                    }
                    break;
                case 1142427447:
                    if (str.equals("floatViewClickPlus8")) {
                        c = '\r';
                        break;
                    }
                    break;
                case 1142427448:
                    if (str.equals("floatViewClickPlus9")) {
                        c = 14;
                        break;
                    }
                    break;
                case 1538179327:
                    if (str.equals("swipeView")) {
                        c = 15;
                        break;
                    }
                    break;
                case 1851924987:
                    if (str.equals("actionView")) {
                        c = 16;
                        break;
                    }
                    break;
            }
            switch (c) {
                case 0:
                    if (!FloatUtil.getIsTip()) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case 1:
                    if (!FloatUtil.getShowRecord()) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case 2:
                    if (!FloatUtil.getShowFlowClick(this.mB.mApplicationContext)) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case 3:
                    if (!FloatUtil.getShowPause()) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case 4:
                    if (!FloatUtil.getShowTrackClick(this.mB.mApplicationContext)) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case 5:
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 0)) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case 6:
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 1)) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case 7:
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 2)) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case '\b':
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 3)) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case '\t':
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 4)) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case '\n':
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 5)) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case 11:
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 6)) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case '\f':
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 7)) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case '\r':
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 8)) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case 14:
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 9)) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case 15:
                    if (!FloatUtil.getSwipe()) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                case 16:
                    if (!FloatUtil.getEdit()) {
                        return;
                    }
                    if (this.once) {
                        this.mFloatView.init();
                        this.once = false;
                        this.isShow = true;
                        return;
                    } else if (!this.isShow) {
                        getView().setVisibility(0);
                        this.isShow = true;
                        return;
                    } else {
                        return;
                    }
                default:
                    return;
            }
        }
    }

    @Override
    public void hide() {
        if (!TextUtils.isEmpty(this.mB.mTag)) {
            String str = this.mB.mTag;
            str.hashCode();
            char c = 65535;
            switch (str.hashCode()) {
                case -1311594016:
                    if (str.equals("tipView")) {
                        c = 0;
                        break;
                    }
                    break;
                case -385679662:
                    if (str.equals("floatViewRecord")) {
                        c = 1;
                        break;
                    }
                    break;
                case 666656487:
                    if (str.equals("floatViewClick")) {
                        c = 2;
                        break;
                    }
                    break;
                case 678346581:
                    if (str.equals("floatViewPause")) {
                        c = 3;
                        break;
                    }
                    break;
                case 1080880344:
                    if (str.equals("trackViewClick")) {
                        c = 4;
                        break;
                    }
                    break;
                case 1142427439:
                    if (str.equals("floatViewClickPlus0")) {
                        c = 5;
                        break;
                    }
                    break;
                case 1142427440:
                    if (str.equals("floatViewClickPlus1")) {
                        c = 6;
                        break;
                    }
                    break;
                case 1142427441:
                    if (str.equals("floatViewClickPlus2")) {
                        c = 7;
                        break;
                    }
                    break;
                case 1142427442:
                    if (str.equals("floatViewClickPlus3")) {
                        c = '\b';
                        break;
                    }
                    break;
                case 1142427443:
                    if (str.equals("floatViewClickPlus4")) {
                        c = '\t';
                        break;
                    }
                    break;
                case 1142427444:
                    if (str.equals("floatViewClickPlus5")) {
                        c = '\n';
                        break;
                    }
                    break;
                case 1142427445:
                    if (str.equals("floatViewClickPlus6")) {
                        c = 11;
                        break;
                    }
                    break;
                case 1142427446:
                    if (str.equals("floatViewClickPlus7")) {
                        c = '\f';
                        break;
                    }
                    break;
                case 1142427447:
                    if (str.equals("floatViewClickPlus8")) {
                        c = '\r';
                        break;
                    }
                    break;
                case 1142427448:
                    if (str.equals("floatViewClickPlus9")) {
                        c = 14;
                        break;
                    }
                    break;
                case 1538179327:
                    if (str.equals("swipeView")) {
                        c = 15;
                        break;
                    }
                    break;
                case 1851924987:
                    if (str.equals("actionView")) {
                        c = 16;
                        break;
                    }
                    break;
            }
            switch (c) {
                case 0:
                    if (!FloatUtil.getIsTip() && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case 1:
                    if (!FloatUtil.getShowRecord() && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case 2:
                    if (!FloatUtil.getShowFlowClick(this.mB.mApplicationContext) && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case 3:
                    if (!FloatUtil.getSwipe() && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case 4:
                    if (!FloatUtil.getShowTrackClick(this.mB.mApplicationContext) && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case 5:
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 0) && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case 6:
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 1) && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case 7:
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 2) && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case '\b':
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 3) && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case '\t':
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 4) && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case '\n':
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 5) && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case 11:
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 6) && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case '\f':
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 7) && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case '\r':
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 8) && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case 14:
                    if (!FloatUtil.getShowFlowClickPlus(this.mB.mApplicationContext, 9) && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case 15:
                    if (!FloatUtil.getEdit() && !this.once && this.isShow) {
                        getView().setVisibility(4);
                        this.isShow = false;
                        return;
                    }
                    return;
                case 16:
                    boolean edit = FloatUtil.getEdit();
                    if (!FloatUtil.getEdit() && !this.once && this.isShow) {
                        getView().setVisibility(View.INVISIBLE);
                        this.isShow = false;
                        return;
                    }
                    return;
                default:
                    return;
            }
        }
    }

    /* access modifiers changed from: package-private */
    @Override // com.yhao.floatwindow.IFloatWindow
    public void dismiss() {
        this.mFloatView.dismiss();
        this.isShow = false;
    }

    @Override // com.yhao.floatwindow.IFloatWindow
    public void updateX(int i) {
        checkMoveType();
        this.mB.xOffset = i;
        FloatUtil.setFloatX(this.mB.mApplicationContext, (float) i, this.mB.mTag);
        this.mFloatView.updateX(i);
    }

    @Override // com.yhao.floatwindow.IFloatWindow
    public void updateSize(int i, int i2) {
        checkMoveType();
        this.mB.mWidth = i;
        this.mB.mHeight = i2;
        this.mFloatView.updateSize(i, i2);
    }

    @Override // com.yhao.floatwindow.IFloatWindow
    public void updateY(int i) {
        if (this.mB.mTag.equals("tipView")) {
            i = 0;
        }
        checkMoveType();
        this.mB.yOffset = i;
        FloatUtil.setFloatX(this.mB.mApplicationContext, (float) i, this.mB.mTag);
        this.mFloatView.updateY(i);
    }

    @Override // com.yhao.floatwindow.IFloatWindow
    public void updateX(int i, float f) {
        int i2;
        checkMoveType();
        FloatWindow.B b = this.mB;
        if (i == 0) {
            i2 = FloatUtil.getScreenWidth(b.mApplicationContext);
        } else {
            i2 = FloatUtil.getScreenHeight(b.mApplicationContext);
        }
        b.xOffset = (int) (((float) i2) * f);
        this.mFloatView.updateX(this.mB.xOffset);
    }

    @Override // com.yhao.floatwindow.IFloatWindow
    public void updateY(int i, float f) {
        int i2;
        checkMoveType();
        FloatWindow.B b = this.mB;
        if (i == 0) {
            i2 = FloatUtil.getScreenWidth(b.mApplicationContext);
        } else {
            i2 = FloatUtil.getScreenHeight(b.mApplicationContext);
        }
        b.yOffset = (int) (((float) i2) * f);
        this.mFloatView.updateY(this.mB.yOffset);
    }

    @Override // com.yhao.floatwindow.IFloatWindow
    public int getX() {
        return this.mFloatView.getX();
    }

    @Override // com.yhao.floatwindow.IFloatWindow
    public int getY() {
        return this.mFloatView.getY();
    }

    @Override // com.yhao.floatwindow.IFloatWindow
    public View getView() {
        return this.mB.mView;
    }

    private void checkMoveType() {
        if (this.mB.mMoveType == 0) {
            throw new IllegalArgumentException("FloatWindow of this tag is not allowed to move!");
        }
    }

    private void initTouchEvent() {
        if (!TextUtils.isEmpty(this.mB.mTag)) {
            String str = this.mB.mTag;
            str.hashCode();
            char c = 65535;
            switch (str.hashCode()) {
                case -385679662:
                    if (str.equals("floatViewRecord")) {
                        c = 0;
                        break;
                    }
                    break;
                case 666656487:
                    if (str.equals("floatViewClick")) {
                        c = 1;
                        break;
                    }
                    break;
                case 678346581:
                    if (str.equals("floatViewPause")) {
                        c = 2;
                        break;
                    }
                    break;
                case 1080880344:
                    if (str.equals("trackViewClick")) {
                        c = 3;
                        break;
                    }
                    break;
                case 1142427439:
                    if (str.equals("floatViewClickPlus0")) {
                        c = 4;
                        break;
                    }
                    break;
                case 1142427440:
                    if (str.equals("floatViewClickPlus1")) {
                        c = 5;
                        break;
                    }
                    break;
                case 1142427441:
                    if (str.equals("floatViewClickPlus2")) {
                        c = 6;
                        break;
                    }
                    break;
                case 1142427442:
                    if (str.equals("floatViewClickPlus3")) {
                        c = 7;
                        break;
                    }
                    break;
                case 1142427443:
                    if (str.equals("floatViewClickPlus4")) {
                        c = '\b';
                        break;
                    }
                    break;
                case 1142427444:
                    if (str.equals("floatViewClickPlus5")) {
                        c = '\t';
                        break;
                    }
                    break;
                case 1142427445:
                    if (str.equals("floatViewClickPlus6")) {
                        c = '\n';
                        break;
                    }
                    break;
                case 1142427446:
                    if (str.equals("floatViewClickPlus7")) {
                        c = 11;
                        break;
                    }
                    break;
                case 1142427447:
                    if (str.equals("floatViewClickPlus8")) {
                        c = '\f';
                        break;
                    }
                    break;
                case 1142427448:
                    if (str.equals("floatViewClickPlus9")) {
                        c = '\r';
                        break;
                    }
                    break;
                case 1538179327:
                    if (str.equals("swipeView")) {
                        c = 14;
                        break;
                    }
                    break;
                case 1851924987:
                    if (str.equals("actionView")) {
                        c = 15;
                        break;
                    }
                    break;
            }
            switch (c) {
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                case '\b':
                case '\t':
                case '\n':
                case 11:
                case '\f':
                case '\r':
                case 14:
                case 15:
                    actionTouch();
                    return;
                default:
                    return;
            }
        }
    }

    private void actionTouch() {
        if (this.mB.mMoveType != 1) {
            getView().setOnTouchListener(new View.OnTouchListener() {
                /* class com.yhao.floatwindow.IFloatWindowImpl.AnonymousClass2 */
                float changeX;
                float changeY;
                float lastX;
                float lastY;
                int newX;
                int newY;

                public boolean onTouch(View view, MotionEvent motionEvent) {
                    EventBus.getDefault().post(motionEvent);
                    int action = motionEvent.getAction();
                    if (action == 0) {
                        this.lastX = motionEvent.getRawX();
                        this.lastY = motionEvent.getRawY();
                        IFloatWindowImpl.this.cancelAnimator();
                        return false;
                    } else if (action != 2) {
                        return false;
                    } else {
                        this.changeX = motionEvent.getRawX() - this.lastX;
                        this.changeY = motionEvent.getRawY() - this.lastY;
                        this.newX = (int) (((float) IFloatWindowImpl.this.mFloatView.getX()) + this.changeX);
                        this.newY = (int) (((float) IFloatWindowImpl.this.mFloatView.getY()) + this.changeY);
                        IFloatWindowImpl.this.mFloatView.updateXY(this.newX, this.newY);
                        int[] iArr = new int[2];
                        view.getLocationOnScreen(iArr);
                        int i = iArr[0];
                        int height = iArr[1] + (view.getHeight() / 2);
                        this.lastX = motionEvent.getRawX();
                        this.lastY = motionEvent.getRawY();
                        FloatUtil.setFloatX(IFloatWindowImpl.this.mB.mApplicationContext, (float) (i + (view.getWidth() / 2)), IFloatWindowImpl.this.mB.mTag);
                        FloatUtil.setFloatY(IFloatWindowImpl.this.mB.mApplicationContext, (float) height, IFloatWindowImpl.this.mB.mTag);
                        EventBus.getDefault().post(new ChangeViewXYBean(IFloatWindowImpl.this.mB.mTag, (int) FloatUtil.getFloatX(IFloatWindowImpl.this.mB.mApplicationContext, IFloatWindowImpl.this.mB.mTag), (int) FloatUtil.getFloatY(IFloatWindowImpl.this.mB.mApplicationContext, IFloatWindowImpl.this.mB.mTag)));
                        return false;
                    }
                }
            });
        }
    }

    private void startAnimator() {
        if (this.mB.mInterpolator == null) {
            if (this.mDecelerateInterpolator == null) {
                this.mDecelerateInterpolator = new DecelerateInterpolator();
            }
            this.mB.mInterpolator = this.mDecelerateInterpolator;
        }
        this.mAnimator.setInterpolator(this.mB.mInterpolator);
        this.mAnimator.addListener(new AnimatorListenerAdapter() {
            /* class com.yhao.floatwindow.IFloatWindowImpl.AnonymousClass3 */

            public void onAnimationEnd(Animator animator) {
                IFloatWindowImpl.this.mAnimator.removeAllUpdateListeners();
                IFloatWindowImpl.this.mAnimator.removeAllListeners();
                IFloatWindowImpl.this.mAnimator = null;
            }
        });
        this.mAnimator.setDuration(this.mB.mDuration).start();
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void cancelAnimator() {
        ValueAnimator valueAnimator = this.mAnimator;
        if (valueAnimator != null && valueAnimator.isRunning()) {
            this.mAnimator.cancel();
        }
    }
}
